package com.bi.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 主题场景实体类
 * 
 * @author BI Platform Team
 * @since 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_theme_scenario")
public class ThemeScenario implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 场景名称（系统内部标识）
     */
    private String name;

    /**
     * 显示名称
     */
    private String displayName;

    /**
     * 场景描述
     */
    private String description;

    /**
     * 场景类型
     */
    private ScenarioType scenarioType;

    /**
     * 应用类型
     */
    private ApplicationType applicationType;

    /**
     * 模板ID
     */
    private Long templateId;

    /**
     * 模板名称
     */
    private String templateName;

    /**
     * 布局配置JSON
     */
    private String layoutConfig;

    /**
     * 主题配置JSON
     */
    private String themeConfig;

    /**
     * 组件配置JSON
     */
    private String componentsConfig;

    /**
     * 交互配置JSON
     */
    private String interactionConfig;

    /**
     * 数据配置JSON
     */
    private String dataConfig;

    /**
     * 样式配置JSON
     */
    private String styleConfig;

    /**
     * 缓存配置JSON
     */
    private String cacheConfig;

    /**
     * 刷新配置JSON
     */
    private String refreshConfig;

    /**
     * 权限配置JSON
     */
    private String permissionConfig;

    /**
     * 预览图片URL
     */
    private String previewUrl;

    /**
     * 缩略图URL
     */
    private String thumbnailUrl;

    /**
     * 访问路径
     */
    private String accessPath;

    /**
     * 是否公开
     */
    private Boolean isPublic;

    /**
     * 是否推荐
     */
    private Boolean isRecommended;

    /**
     * 访问次数
     */
    private Integer accessCount;

    /**
     * 评分
     */
    private Double rating;

    /**
     * 标签JSON数组
     */
    private String tags;

    /**
     * 状态
     */
    private ScenarioStatus status;

    /**
     * 发布时间
     */
    private LocalDateTime publishTime;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 版本号
     */
    @Version
    private Integer version;

    /**
     * 场景类型枚举
     */
    public enum ScenarioType {
        DASHBOARD("仪表盘"),
        REPORT("报表"),
        ANALYSIS("分析"),
        MONITOR("监控"),
        PRESENTATION("展示"),
        INTERACTIVE("交互式"),
        REALTIME("实时"),
        CUSTOM("自定义");

        private final String description;

        ScenarioType(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 应用类型枚举
     */
    public enum ApplicationType {
        PC("PC端"),
        MOBILE("移动端"),
        PAD("平板端"),
        LARGE_SCREEN("大屏端"),
        TV("电视端"),
        UNIVERSAL("通用");

        private final String description;

        ApplicationType(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    /**
     * 场景状态枚举
     */
    public enum ScenarioStatus {
        DRAFT("草稿"),
        SUBMITTED("已提交"),
        APPROVED("已审批"),
        REJECTED("已拒绝"),
        PUBLISHED("已发布"),
        ARCHIVED("已归档"),
        DELETED("已删除");

        private final String description;

        ScenarioStatus(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }
}